<template>
  <el-dialog :title="title" :visible.sync="visible" width="900px" append-to-body>
    <el-form class="detail-dialog" inline :model="form" label-width="170px">
<!--      <el-form-item label="activeInd名称" prop="activeInd">
        <div>{{ form.activeInd }}</div>
      </el-form-item>
      <el-form-item label="amount名称" prop="amount">
        <div>{{ form.amount }}</div>
      </el-form-item>
      <el-form-item label="backTime名称" prop="backTime">
        <div>{{ form.backTime }}</div>
      </el-form-item>
      <el-form-item label="backWorkerId名称" prop="backWorkerId">
        <div>{{ form.backWorkerId }}</div>
      </el-form-item>
      <el-form-item label="checkIndex名称" prop="checkIndex">
        <div>{{ form.checkIndex }}</div>
      </el-form-item>
      <el-form-item label="ciden名称" prop="ciden">
        <div>{{ form.ciden }}</div>
      </el-form-item>-->
        <div class="text-area" v-html="form.contractContent"></div>

<!--      <el-form-item label="合同编号" prop="contractId">
        <div>{{ form.contractId }}</div>
      </el-form-item>
      <el-form-item label="contractType名称" prop="contractType">
        <div>{{ form.contractType }}</div>
      </el-form-item>
      <el-form-item label="dispatchWorkerId名称" prop="dispatchWorkerId">
        <div>{{ form.dispatchWorkerId }}</div>
      </el-form-item>
      <el-form-item label="getTime名称" prop="getTime">
        <div>{{ form.getTime }}</div>
      </el-form-item>
      <el-form-item label="isNew名称" prop="isNew">
        <div>{{ form.isNew }}</div>
      </el-form-item>
      <el-form-item label="printNum名称" prop="printNum">
        <div>{{ form.printNum }}</div>
      </el-form-item>
      <el-form-item label="printTime名称" prop="printTime">
        <div>{{ form.printTime }}</div>
      </el-form-item>
      <el-form-item label="二维码链接" prop="qrCodeUrl">
        <div>{{ form.qrCodeUrl }}</div>
      </el-form-item>
      <el-form-item label="销售订单编号" prop="saleOrderId">
        <div>{{ form.saleOrderId }}</div>
      </el-form-item>
      <el-form-item label="signingUrl名称" prop="signingUrl">
        <div>{{ form.signingUrl }}</div>
      </el-form-item>
      <el-form-item label="workerId名称" prop="workerId">
        <div>{{ form.workerId }}</div>
      </el-form-item>
      <el-form-item label="永昌合同编号" prop="ycContract">
        <div>{{ form.ycContract }}</div>
      </el-form-item>
      <el-form-item label="ycState名称" prop="ycState">
        <div>{{ form.ycState }}</div>
      </el-form-item>-->
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="submitForm">确 定</el-button>
    </div>
  </el-dialog>
</template>

<script>
import {getById} from "@/api/salepurchase/contract";

export default {
  name: "detail",
  data() {
    return {
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      visible: false,
      // 表单参数
      form: {
        activeInd: 0,
        amount: "",
        backTime: "",
        backWorkerId: "",
        checkIndex: 0,
        ciden: 0,
        contractContent: "",
        contractId: "",
        contractType: "",
        dispatchWorkerId: "",
        getTime: "",
        isNew: 0,
        printNum: 0,
        printTime: "",
        qrCodeUrl: "",
        saleOrderId: "",
        signingUrl: "",
        workerId: "",
        ycContract: "",
        ycState: 0
      },
    }
  },
  methods: {
    open(id) {
      if (id) {
        getById(id).then(response => {
          this.form = response.data
          this.visible = true
          this.title = "合同详情"
        })
      }
    },
    /** 提交按钮 */
    submitForm() {
      this.visible = false
    },
  }
}
</script>
<style lang="scss" scoped>
.detail-dialog {
  .el-form-item {
    width: 40%;
  }

  .full-line {
    width: 100%;

    ::v-deep .el-form-item__label {
      display: block;
    }

    ::v-deep .el-form-item__content {
      width: 100%;

      .text-area {
        border: 1px solid #EBEEF5;
      }
    }
  }
}
</style>
